package rmaqlc31.basic;

public class J13_Q77_Books_OOP {

	public static void main(String[] args) {
		// 도서 관리 시스템 ( OOP )
		J13_Book book = new J13_Book(12345,"누구나 알기 쉬운","혜지원",
									"카와바 타케시","스릴러","22500",false,
									"2014-06-10");
		
		J13_Book[] books = new J13_Book[5];
		// 대여한 책을 저장하기 위해 배열 선언
		books[0] = book;	// 대여한 책을 배열에 저장
		
		J13_Member member = new J13_Member(98765, "수지", "123-456-789", "경기도 고양시",
				books, 12345);
		
		// 도서정보 출력
		System.out.println(book.toString());
		System.out.println(member.toString());
		
		
	} // main

} // class

class J13_Book {
	private int bookNo;
	private String bookName;
	private String publisher;
	private String author;
	private String genre;
	private String price;
	private boolean isRent;
	private String regDate;
	
	public J13_Book(int bookNo, String bookName,
			String publisher,String author, String genre,
			String price, boolean isRent, String regDate) {
		this.bookNo = bookNo;
		this.bookName = bookName;
		this.publisher = publisher;
		this.author = author;
		this.genre = genre;
		this.price = price;
		this.isRent = isRent;
		this.regDate = regDate;
	}
	
	@Override
	public String toString() {
		String bookInfo = "도서번호 : "+bookNo;
		bookInfo += " 도서명 : "+bookName;
		bookInfo += " 출판사 : "+publisher;
		bookInfo += " 지은이 : "+author;
		bookInfo += " 장르 : "+genre;
		bookInfo += " 가격 : "+price;
		bookInfo += " 대여여부 : "+isRent;
		bookInfo += " 등록일 : "+regDate;
		return bookInfo;
	}
	
}

class J13_Member {
	private int memberNo;
	private String name;
	private String telNo;
	private String address;
//	private J13_Book rbook1;
//	private J13_Book rbook2;
//	private J13_Book rbook3;
//	private J13_Book rbook4;
//	private J13_Book rbook5;
	private J13_Book[] rbooks;
	private int mileage;
	
	public J13_Member(int memberNo, String name, String telNo, String address,
			J13_Book[] rbooks, int mileage) {
		this.memberNo = memberNo;
		this.name = name;
		this.telNo = telNo;
		this.address = address;
		this.rbooks = rbooks;
		this.mileage = mileage;
	}
	
	@Override
	public String toString() {
		String memberInfo = "회원번호 : "+memberNo;
		memberInfo +=" 이름 : "+name;
		memberInfo +=" 전화번호 : "+telNo;
		memberInfo +=" 주소 : "+address;
		memberInfo +=" 대여중인책 : "+rbooks;
		memberInfo +=" 마일리지 : "+mileage;
		return memberInfo;
	}
	
}









